<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>随机整数</title>
</head>
<body>
    <script>
        var arr = [];
        for (i = 0; i < 10; i++) {
            arr[i] = i + 1;  // 通过循环来追加数组 直接将循环后的值 赋给空的数组
        }
        console.log(arr);
        
    </script>
</body>
</html>